//
//  SDCommonwealViewController.m
//  SuperDoctor
//
//  Created by 李忠 on 7/9/16.
//  Copyright © 2016 SD. All rights reserved.
//

#import "SDCommonwealViewController.h"
#import "SVProgressHUD.h"

@interface SDCommonwealViewController () <UIWebViewDelegate>
@property (nonatomic, strong) UIWebView *webview;
@end

@implementation SDCommonwealViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self loadWeView];
}

- (void)loadWeView{
    [SVProgressHUD setMinimumDismissTimeInterval:15];
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeBlack];
    [SVProgressHUD showWithStatus:@""];
    NSString *urlString = @"http://202.106.210.115:18080/hyde-pluto-h360/nt/appEntrance.htm";
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlString]];
    [self.webview loadRequest:request];
    
}

- (void)webViewDidFinishLoad:(UIWebView *)webView{
    [SVProgressHUD dismiss];
}


- (UIWebView *)webview{
    if (_webview == nil) {
        _webview = [[UIWebView alloc] init];
        [self.view addSubview:_webview];
        _webview.delegate = self;
        [_webview mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.edges.mas_equalTo(UIEdgeInsetsMake(0, 0, 0, 0));
            
        }];
    }
    return _webview;
}

@end
